public class Liczba {
	
	private int Value;
	private static final String pattern = "0123456789abcdef";
	
	public void setValue(int Value) throws LiczbaExcept{
		if(Value < 0 || Value > 100000000) throw new LiczbaExcept("Wrong data1");
		this.Value = Value;
	}
	
	public String convertTo(int base) throws LiczbaExcept{
		if(base <2 || base >17) throw new LiczbaExcept("Wrong base2");
		int n = this.Value;
	   String result = "";
	   if (n == 0)
	   return "0";
	   
	   while (n>0)
	   {
	      result = pattern.charAt(n % base) + result;
	      n /= base;
	   }
	   return result;
	}

}
